package types

import (
	"context"
	proto "xagent/proto/v1"
)

// Agent defines the interface for all agents in the system
type Agent interface {
	// Core agent methods
	GetID() string
	GetName() string
	GetRole() string
	GetDescription() string
	GetCapabilities() []string

	// Role management
	AssignRole(role Role) error
	GetCurrentRole() Role

	// Action management
	AddAction(action Action) error
	GetActions() []Action
	ExecuteAction(ctx context.Context, actionName string, input interface{}) (*proto.AgentMessage, error)

	// Task handling
	ProcessTask(task *proto.Task) error
	HandleMessage(msg *proto.AgentMessage) error

	// State management
	GetState() State
	SetState(state State)
}

// Role defines the interface for agent roles
type Role interface {
	// Core role methods
	GetName() string
	GetDescription() string
	GetCapabilities() []string

	// Action management
	GetActions() []Action
	AddAction(action Action) error

	// Role-specific behavior
	OnAssign(agent Agent) error
	OnRevoke(agent Agent) error
}

// ResourceManager defines the interface for resource management
type ResourceManager interface {
	AllocateResources(taskID string, resources map[string]float64) error
	ReleaseResources(taskID string) error
	GetResourceUsage() map[string]float64
	GetAvailableResources() map[string]float64
	GetMaxLoadPerAgent() int
	GetMaxMigrationCost() float64
}
